# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=curaengine
# If you plan to upgrade curaengine, you also need to upgrade libarcus at the same time
pkgver=4.13.1
pkgrel=1
pkgdesc="3D slicer engine"
url="https://github.com/Ultimaker/CuraEngine"
license="AGPL-3.0-or-later"
arch="all !x86" # test suite fails on x86
makedepends="
	cmake
	libarcus-dev
	protobuf-dev
	"
source="https://github.com/Ultimaker/CuraEngine/archive/$pkgver/CuraEngine-$pkgver.tar.gz
	"
options="net" # Required to download dependencies, TODO: stop network usage
builddir="$srcdir/CuraEngine-$pkgver"

build() {
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DBUILD_TESTS=ON \
		-DSET_RPATH=OFF
	cmake --build build
}

check() {
	cmake --build build --target test
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
224379a40e26ae0026a3849d582353e49edf99520401e1fef56c9504638c68c62cfe394dab0eb40e4a447bfe0bfa506a880512e84fd6057a839b6384087c46d0  CuraEngine-4.13.1.tar.gz
"
